from typing import List


class Solution:
    def minPairSum(self, nums: List[int]) -> int:
        nums.sort()
        size = len(nums)
        ans = 0
        for i in range(size // 2):
            ans = max(ans, nums[i] + nums[-i - 1])
        return ans


if __name__ == "__main__":
    print(Solution().minPairSum([3, 5, 2, 3]))  # 7
    print(Solution().minPairSum([3, 5, 4, 2, 4, 6]))  # 8
